import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2024-02-03
 * Time:7:43
 */
public class Solution {
    //Stack<String> stack = new Stack<>();  //存放数字字符

/*    public int evalRPN(String[] tokens) {

        for(String str:tokens) {
            if(str == "+" || str == "-" || str == "*" || str == "/") {
                int num2 = Integer.parseInt(stack.pop()); //右操作数
                int num1 = Integer.parseInt(stack.pop()); //左操作数
                int num = 0;
                switch (str) {
                    case "+":
                        num = num1 + num2;
                        stack.push(String.valueOf(num));
                        break;
                    case "-":
                        num = num1 - num2;
                        stack.push(String.valueOf(num));
                        break;
                    case "*":
                        num = num1 * num2;
                        stack.push(String.valueOf(num));
                        break;
                    case "/":
                        num = num1 / num2;
                        stack.push(String.valueOf(num));
                        break;
                }
            } else {
                //数字字符，入栈
                stack.push(str);
            }

        }
        return Integer.parseInt(stack.peek());
    }
*/

/*
    public int evalRPN(String[] tokens) {
        for(String str:tokens) {
            if(str == "+" || str == "-" || str == "*" || str == "/") {
                int num2 = stack.pop();
                int num1 = stack.pop();
                switch (str) {
                    case "+":
                        stack.push(num1+num2);
                        break;
                    case "-":
                        stack.push(num1-num2);
                        break;
                    case "*":
                        stack.push(num1*num2);
                        break;
                    case "/":
                        stack.push(num1/num2);
                        break;
                }
            } else {
                stack.push(Integer.parseInt(str));
            }
            return stack.peek();
    }
*/

}
